package com.ch.home.testMapper;

import com.ch.home.bean.DishLiterary;
import com.ch.home.mapper.restDishMapper.DishLiteraryMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.LinkedList;

/**
 * Created by CHEN on 2019/8/28.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class testDishLiteraryMapper {


    @Autowired
    DishLiteraryMapper dishLiteraryMapper;


//    LinkedList<DishLiterary> getDishLiterary(DishLiterary dishLiterary);
//
//    LinkedList<DishLiterary> getDishLiteraryAndSource(DishLiterary dishLiterary);
//
//    int addDishLiterary(DishLiterary dishLiterary);
//
//    int updateDishLiterary(DishLiterary dishLiterary);

    @Test
    public void testGetDishLiterary() {

        LinkedList<DishLiterary> dishLiterary = dishLiteraryMapper.getDishLiterary(new DishLiterary(null, 1, null, null, null, null));
        System.out.println(dishLiterary);

    }

    @Test
    public void testGetDishLiteraryAndSource() {


        LinkedList<DishLiterary> dishLiterary = dishLiteraryMapper.getDishLiteraryAndSource(new DishLiterary(null, 1, null, null, null, null));
        System.out.println(dishLiterary);
    }


    @Test
    public void testAddDishLiterary() {

        DishLiterary dishLiterary = new DishLiterary(null, 1, "九月九日忆山东兄弟", "eee,quxiangxiangtiange,baimaofulushui,gongzaoboqingbo", null, null);
        int re = dishLiteraryMapper.addDishLiterary(dishLiterary);

        System.out.println(re);
        System.out.println("---------------------");
        System.out.println(dishLiterary);

    }

    @Test
    public void testUpateDishLiterary(){
        DishLiterary dishLiterary = new DishLiterary(2, 1, "八月八日忆山东兄弟", "eee,quxiangxiangtiange,baimaofulushui,gongzaoboqingbo", null, null);

        int re = dishLiteraryMapper.updateDishLiterary(dishLiterary);

        System.out.println(re );
        System.out.println("----------------------" );
    }


}
